import request from "@/utils/request";


/**
 * 获取表单
 * @param name
 * @returns {Promise | Promise<unknown>}
 */
export function getTableSetting(name){
  return request({
    url: `/table/getTableConfig/${name}`,
    method: 'get',
  })
}

/**
 * 设置表单
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export function setTableConfig(data){
  return request({
    url: `/table/setTableConfig`,
    method: 'post',
    data,
    handleError: true,
  })
}

/**
 * 获取用户设置
 * @returns {Promise<unknown>}
 */
export function getSystemSetting(){
  return request({
    url: '/setting/getSystemSetting',
  })
}

/**
 * 保存用户设置
 * @param data
 * @returns {Promise<unknown>}
 */
export function saveSystemSetting(data){
  return request({
    url: '/setting/saveSystemSetting',
    method: 'put',
    data,
  })
}
